<include file='Index/header'/>
<script language="javascript" type="text/javascript" src="__PUBLIC__/My97DatePicker/WdatePicker.js"></script>
<style>
    hr {
        height: -10px;
        margin: 0 0;

    }

    /*#class {*/
        /*height: 30px;*/
        /*width: 100px;*/
    /*}*/

    td {
        line-height: 30px;

    }

    .tb {
        /*height: 600px;*/

    }

</style>
<include file='Index/left'/>


<div class="content">
    <div class="well well-sm" style="height:100px;">
        <ul class="nav nav-tabs">
            <li class="active">
                <a href="javascript:void(0)" onclick="window.location.href='__CONTROLLER__/index2/fs/now.html'"
                   data-toggle="tab">模式一
                </a>
            </li>
            <li >
                <a href="javascript:void(0)"  onclick="window.location.href='__CONTROLLER__/index'"
                                  data-toggle="tab">模式二
                </a>
            </li>

        </ul>
        <form id="cx" name="cx" method="post">
            &nbsp;&nbsp;&nbsp;&nbsp;
            <lable>起止时间：</lable>
            <input type="text" name="start_time" onClick="WdatePicker()" placeholder="" style="width:120px">
            ~
            <input type="text" name="end_time" onClick="WdatePicker()" placeholder="" style="width:120px">
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <button type="button" class="btn btn-primary" onclick="submit()">&nbsp;&nbsp;查&nbsp;&nbsp;询&nbsp;&nbsp;
            </button>
        </form>
    </div>

    <div class="well" id='well2'>
        <div style="margin-left:50px;text-align:center">
            <div class="tb">
                <table border="1">
                    <tr>
                        <td width="100px" nowrap align="center" bgcolor="#999999">日期</td>
                        <td width="80px" align="center" nowrap bgcolor="#999999">午别</td>
                        <volist name='arrSchedule' id='vs'>
                            <td width="200px" align="center" bgcolor="#999999">{$vs['schename']}
                            </td>
                        </volist>
                        <td align="center" bgcolor="#999999">总数</td>
                    </tr>

                    <tr>
                        <td width="50px" colspan="2" align="center" nowrap="nowrap">班次编号</td>
                        <volist name='arrSchedule' id='vs'>
                            <td width="50px" nowrap="nowrap" align="center">
                                {$vs['scheid']}
                            </td>
                        </volist>
                        <td ></td>
                    </tr>

                    <tr>
                        <td width="50px" colspan="2" align="center" nowrap="nowrap">人数/单间数/标间数</td>
                        <volist name='arrSchedule' id='vs'>
                            <td width="50px" nowrap="nowrap" align="center">
                                {$vs['peoplenum']}/{$vs['singleroomnum']}/{$vs['standardroomnum']}
                            </td>
                        </volist>
                        <td nowrap="nowrap" style="border-style:solid;border-width:2px;border-color: red;">
                            <?=isset($sumPeople[0]['sum(peoplenum)'])?$sumPeople[0]['sum(peoplenum)']:0 ?>/
                            <?=isset($sumSingle[0]['sum(singleroomnum)'])?$sumSingle[0]['sum(singleroomnum)']:0 ?>/
                            <?=isset($sumStandard[0]['sum(standardroomnum)'])?$sumStandard[0]['sum(standardroomnum)']:0 ?>
                        </td>
                    </tr>

                    <tr>
                        <td width="50px" colspan="2" align="center" nowrap="nowrap">接班老师</td>
                        <volist name='arrSchedule' id='vs'>
                            <td width="50px" nowrap="nowrap" align="center">
                                {$vs['jteacher']}
                            </td>
                        </volist>
                        <td rowspan="6"></td>
                    </tr>

                    <tr>
                        <td width="50px" colspan="2" align="center" nowrap="nowrap">带班老师</td>
                        <volist name='arrSchedule' id='vs'>
                            <td width="50px" nowrap="nowrap" align="center">
                                {$vs['dteacher']}
                            </td>
                        </volist>
                    </tr>

                    <tr>
                        <td width="50px" colspan="2" align="center" nowrap="nowrap">值班领导</td>
                        <volist name='arrSchedule' id='vs'>
                            <td width="50px" nowrap="nowrap" align="center">
                                {$vs['onleader']}
                            </td>
                        </volist>
                    </tr>

                    <tr>
                        <td width="50px" colspan="2" align="center" nowrap="nowrap">车号</td>
                        <volist name='arrSchedule' id='vs'>
                            <td width="50px" nowrap="nowrap" align="center">
                                {$vs['carnum']}
                            </td>
                        </volist>
                    </tr>

                    <tr>
                        <td width="50px" colspan="2" align="center" nowrap="nowrap">联系人信息</td>
                        <volist name='arrSchedule' id='vs'>
                            <td width="50px" nowrap="nowrap" align="center">
                                {$vs['linkmanname']}{$vs['linkmanphone']}
                            </td>
                        </volist>
                    </tr>

                    <tr>
                        <td width="50px" colspan="2" align="center" nowrap="nowrap">备注</td>
                        <volist name='arrSchedule' id='vs'>
                            <td width="50px" nowrap="nowrap" align="center">
                                {$vs['remark']}
                            </td>
                        </volist>
                    </tr>

                    <volist name='arrCourse' id='vo' key='k'>
                        <tr>
                            <td rowspan="3" align="center" style="border-style:solid;border-bottom-width:2px;border-top-width:2px;"><p> {$key}</p>
                                <switch name="key|strtotime|date='w',###">
                                    <case value="1">(星期一)</case>
                                    <case value="2">(星期二)</case>
                                    <case value="3">(星期三)</case>
                                    <case value="4">(星期四)</case>
                                    <case value="5">(星期五)</case>
                                    <case value="6">(星期六)</case>
                                    <case value="0">(星期日)</case>
                                    <default/>
                                    数据错误
                                </switch>
                            </td>

                            <td align="center" style="border-style:solid;border-top-width:2px;">上午</td>
                            <volist name='arrSchedule' id='vd'>
                                <td align="center" style="border-style:solid;border-top-width:2px;">
                                    <volist name='vo' id='vp'>
                                        <!--<p>-->
                                            <if condition="($vp['is_am'] eq '1') and ($vp['schedule_id'] eq $vd['id'])">
                                                <!--<a href='javascript:void(0)'
                                                   onclick="kcshow('{$vp.coursename}',{$vp.id})">{$vp['coursename']}</a>-->
                                                {$vp['coursename']}
                                                <hr/>
                                            </if>
                                        <!--</p>-->
                                    </volist>
                                </td>
                            </volist>
                            <td rowspan="3" style="border-style:solid;border-top-width:2px;border-bottom-width:2px;">{$vo.peoplenum}/{$vo.singleroomnum}/{$vo.standardroomnum}</td>
                        </tr>

                        <tr>
                            <td align="center">下午</td>
                            <volist name='arrSchedule' id='vd1'>
                                <td align="center" width="100px">
                                    <volist name='vo' id='vp'>
                                        <!--<p>-->
                                            <if condition="($vp['is_am'] eq '2') and ($vp['schedule_id'] eq $vd1['id'])">
                                                <!--<a href='javascript:void(0)'
                                                   onclick="kcshow('{$vp.coursename}',{$vp.id})">{$vp['coursename']}</a>-->
                                                {$vp['coursename']}
                                                <hr/>
                                            </if>
                                        <!--</p>-->
                                    </volist>
                                </td>
                            </volist>
                        </tr>
                        <tr>
                            <td align="center" style="border-style:solid;border-bottom-width:2px;">晚上</td>
                            <volist name='arrSchedule' id='vd1'>
                                <td align="center" width="100px" style="border-style:solid;border-bottom-width:2px;">
                                    <volist name='vo' id='vp'>
                                        <!--<p>-->
                                            <if condition="($vp['is_am'] eq '3') and ($vp['schedule_id'] eq $vd1['id'])">
                                                <!--<a href='javascript:void(0)'
                                                   onclick="kcshow('{$vp.coursename}',{$vp.id})">{$vp['coursename']}</a>-->
                                                {$vp['coursename']}
                                                <hr/>
                                            </if>
                                        <!--</p>-->
                                    </volist>
                                </td>
                            </volist>
                        </tr>
                    </volist>
                </table>
            </div>

            <br/>

        </div>

    </div>
    <div style='text-align:center'>
        <if condition="$sd neq ''">
            <div>
                <a href="{:U('Index/index2',array('fs'=>'up','sd'=>$sd))}">
                    <button type="button" class="btn btn-default btn-lg">上一周</button>
                </a>
                &nbsp;&nbsp;| &nbsp;&nbsp;
                <a href="{:U('Index/index2',array('fs'=>'now'))}">
                    <button type="button" class="btn btn-default btn-lg">本周</button>
                </a>
                &nbsp;&nbsp;| &nbsp;&nbsp;
                <a href="{:U('Index/index2',array('fs'=>'down','sd'=>$sd))}">
                    <button type="button" class="btn btn-default btn-lg">下一周</button>
                </a>
            </div>
        </if>
    </div>
    <div class="container-fluid">
        <div class="row-fluid">
            <div class="row-fluid">
                <div class="alert alert-info">
                    <button type="button" class="close" data-dismiss="alert">×</button>
                    <h4>Ver:</h4> 1.0.0
                </div>
                <div class="modal fade" id="myModal" tabindex="-1" role="dialog"
                     aria-labelledby="myModalLabel" aria-hidden="true">
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <div class="modal-header">
                                <button type="button" class="close"
                                        data-dismiss="modal" aria-hidden="true">
                                    &times;
                                </button>
                                <h4 class="modal-title" id="myModalLabel">
                                    课程信息
                                </h4>
                            </div>
                            <div>
                                <div id='listsp'></div>
                            </div>
                        </div><!-- /.modal-content -->
                    </div><!-- /.modal -->
                </div>
                <div class="modal fade" id="myModal2" tabindex="-1" role="dialog"
                     aria-labelledby="myModalLabel" aria-hidden="true">
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <div class="modal-header">
                                <button type="button" class="close"
                                        data-dismiss="modal" aria-hidden="true">
                                    &times;
                                </button>
                                <h4 class="modal-title" id="myModalLabel">

                                </h4>
                            </div>
                            <div>
                                <div id='listsp2'></div>
                            </div>
                        </div><!-- /.modal-content -->
                    </div><!-- /.modal -->
                </div>
            </div>
            <script type="text/javascript">
                function saves(id, value) {
                    $.ajax({
                        type: "POST",
                        url: "__CONTROLLER__/saveclass",

                        cache: false,
                        data: {
                            id: id,
                            value: value
                        },
                        success: function (data) {
                            window.location.reload();
                        }
                    });
                }

                function kcshow(bcbh, bh) {
                    $.ajax({
                        type: "POST",
                        url: "__CONTROLLER__/kcshow",

                        cache: false,
                        data: {
                            kcname: bcbh,
                            bh: bh
                        },

                        success: function (data) {
                            $('#listsp').html(data);
                            $('#myModal').modal('show');
                            $('#myModal').modal().css({
                                width: '1000px',
                                height: '500px',
                                'margin-left': function () {
                                    return -($(this).width() / 2);
                                }
                            });
                        }
                    });
                }

                function bcshow(bcbh) {
                    $.ajax({
                        type: "POST",
                        url: "__CONTROLLER__/bcshow",
                        cache: false,
                        data: {
                            bcmc: bcbh
                        },

                        success: function (data) {
                            $('#listsp2').html(data);
                            $('#myModal2').modal('show');
                            $('#myModal2').modal().css({
                                width: '1000px',
                                height: '500px',
                                'margin-left': function () {
                                    return -($(this).width() / 2);
                                }
                            });
                        }
                    })
                }
            </script>

            <include file='Index/footer'/>
 